#!/usr/bin/python
# -*- coding: cp1250 -*-

from pepe.glib import *

if __name__ == "__main__":
    print '''
    replace multiple spaces with one
    '''
    if len(sys.argv) == 2:
 
        f = sys.argv[1]
        #tnow = timenow()
        of = open(f + '_', 'w')

        for line in bt.lines(f):
            line = re.sub(' {2,}', ' ', line)
            of.write(line)

        of.close()

    else:
        print 'wrong syntax, do better'